package com.king01.controller;

import com.king01.service.StaffService;
import com.king01.vo.LoginVo;
import com.king01.vo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ：lqs
 * @date ：Created in 2023/9/25 16:34
 * @description：
 * @modified By：
 * @version:
 */
@RestController //@Controller+@ResponseBody.  该类中所有的方法返回的都是json数据。
public class LoginController {
    @Autowired
    private StaffService staffService;
    @RequestMapping("/login")
    public Result login(@RequestBody LoginVo loginVo){
        Result result = staffService.findByNameAndPwd(loginVo.getUsername(), loginVo.getPassword());
        return result;


    }
}

